trying to sort out some stuff for js