refactored print_names method