cleaned up code and renamed variables! :)