broken again

this is the merge where, b4 i merged, the simplfied version was workn. i added more JS, and now it's broke.