fixed spelling errors and cleaned up javasccript