Implementing printFrom method