cleared up a lot of javascript