some more work wiring it all up with JS