starting to trim the code to make it more efficient