added create_leaves() and print_leaves()