changed write instruction to print