random js fixes

this should get it to the point where it was working when I left it.