started cleaning up the code, removed unnecessary variables and functions, as well as fixed a minor issue