Removed unused debugging. Refactored variable names.