pset1 from CS50.tv http://cdn.cs50.net/2013/fall/psets/1/pset1/pset1.html