Added comments and new constructor to receive user input.