Program Updated with Comments

The program has been updated with comments and the code has been
indented to improve readibility