user configurable threshold, newer jquery, re-draw update function