cleaned up the dang javascript