def undo_move(board, col, piece):
    """removes the topmost piece from that column(undoing move)"""
    for row in range(6):
        if board[row][col] == piece:
            board[row][col] = " "
            break
    return board