basic visitor pattern functionality
printing using visitor