cleaned up some variable confusion
fixed typo