first commit for lab6, contains most of the javascript, a notable portion of which was based heavily on code provided to us