js working, needs a bit of calibration