added recursion for displaying nested objects