moved all print() calls into callbacks