in progress code though no bugs, slowly converting jquery stuff to native javascript