Added comments, vastly improved input mechanism