got rid of a lot of the unnecessary code