Added print stmts for clarity.