Changed system.out.write to print