introduced helper functions
added print_error() and introduced yes_or_no()