refactored up to line 792

Changed names, added spaces, blah blah.