Code cleanup and comments++