implemented printing function
print