modded main.cpp, removed some bugs and created method stubs