Starting to clean up code.  Made changes to getPellysData function