updated code to print the data properly