peppering the code with printfs