Took out useless code and added more comments