added print functionality
formatted output