bugfix: make limit work (otherwise x == 1 never returns True)
simplify target limiting logic