adds print_by method