Programming assignment 2 from adworse