remove debugging prints, add logging