updated code to fit js standards, two remaining errors that i cannot figure out (when i change them, my code ceases to function)