Wrong location
cleaned up code a little.  Broke larger functions into smaller ones.