Removed unnecessary variables and changed some names