Problem set 4 for Harvard's cs50 Spring 2014 course