Renamed some variables in more logical way.