Renamed a number of variables so that they are more indicative of their
purpose