Added comments, changed to include headers, fixed xbmain.cpp