completed programming assignment 2 with comments