Moved debug printing to a seperate function to allow it to be commented out easily when it isn't needed.  This function and any calls to it should be removed before turning in.