removed unused vars, redundant declarations, spell errors, js reserved words.