renaming more variables, removed boiler plate code