cleaned up the js a bit