I don't know python very well, but these function definitions all look sad ):