adjusted script so that it is functional at a level where it works within the parameters given, now to clean it up a bit!  and hopefully use the data points stored with .data(key).