Removed unneeded variables and fixed some comments