Whoops! Needed to check fabs(deviation) <= target, not deviation <= target. Also, fixed some formatting stuff.