Program assignment 2

This was a little tricky