Coding exercise for Nulogy Web Developer Winter 2013 interview