lots of javascript so user no longer has to reload the page