version with added printfs