Cleaned up a few things, and transfered all the code over to the main file