Simplified PrintStmt and working on WriteStmt.