Final Programming Assignment 2

Corrected the lack of comments and readability