Renamed variables and functions to correctly reflect their meanings