Corrected syntax errors in order to build plus added some logic fixes and comments. Also ran for the first time, output included