Renamed some vars and functions