Programming assignment 2 -- hopefully done