removed unneeded variables and clarified names