changed prints to log statements