Renamed variables/functions. Updated comments.