abstracted print statement and reset variabales after print