Tested changes and they seem to work.  Combined some if statements into one statment.  Removed the code I had commented out.