Compiled the files and fixed some bugs

Mostly formatting and a logic error