making the js a little bit less horrible