Made the code more readable.
Made changes to project file to let it be compiled on 32 bit windows.
Moved how some objects get deleted.