hard-stop for more accuracy
simplify equation
cache constants for more performance and readability
changed comment
added active-stop for zero-movement