Worked on printing function