cleaned up the code a bit and removed a silly print statement used in testing.  no changes to the meat of the script though and it is tested and working.