Misused variable names. Removed debug.