Programming assignment 2 (finished)