fixed up a lot of things to make the program run