Cleared the code of some unnecessary auxiliary variables.