Thanks to @ENU1234 for quite a bit of the code and @Palbot. I just fixed the dots so they go always to mouse.