Homework Week2

Re: [this error](https://travis-ci.org/bfl-itp/instructional/builds/35647052#L79), It's considered good style to define functions/variables before you use them. In other words, move these functions to line ~4.