fixed up the main file and tests a bit