removed unneeded variable and added some comments