               }}
             end
           end) |> Enum.into(%{})
+          data = set_lowest_bid(data)
         else
           buyer_bids = [{id, bid} | data.buyer_bids]
           if is_nil(data.highest_bid) or bid > elem(data.highest_bid, 1) do

              }}
            end
          end) |> Enum.into(%{})
        else
          seller_bids = [{id, bid} | data.seller_bids]
          if is_nil(data.lowest_bid) or bid < elem(data.lowest_bid, 1) do

          end) |> Enum.into(%{})
        end
      # Buyer
      %{role: "buyer", bidded: bidded, bid: previous_bid, money: money, dealt: false} when not is_nil(money) and bid <= money ->
        if previous_bid != nil do
          data = %{data | buyer_bids: List.delete(data.buyer_bids, {id, previous_bid})}
          if not is_nil(data.highest_bid) and elem(data.highest_bid, 0) == id do
            data = set_highest_bid(data)
          end
        end
        if not is_nil(data.lowest_bid) and bid >= elem(data.lowest_bid, 1) do
          now = DateTime.today()
          seller_id = elem(data.lowest_bid, 0)
          deals = [{bid, now, {id, seller_id}} | data.deals]
          seller_bids = List.delete(data.seller_bids, data.lowest_bid)
          data = %{data | deals: deals, seller_bids: seller_bids}
          data = dealt(data, id, seller_id, bid)

          host_action = %{
            type: "DEALT",
            sellerID: seller_id, buyerID: id, time: now,
            money: bid, money2: elem(data.lowest_bid, 1), previousBid: previous_bid
          }
          participant_actions = Enum.map(data.participants, fn {p_id, _} ->
            if p_id == seller_id or p_id == id do
