printfs to debug each step