Renamed variable, shuffled some code.