Removed unnecessary code lines and renamed one variable