fixed jiggling algorithm, now works brilliantly