switching out most of the prints for logging statements