Problem Set 4 for CS50x