add mark's JS code