removed final redundant varibles, commented code more