streamlined all the code, elminiated unnecessaries