removed prints, converted some to logging