Code optimizing–removing redundancies, creating variables for DOM object...

...s, minor tweaks