Renamed some internal variables for clarity