     apply(__MODULE__, type, [{type, event}, model, new_events])
   end
 
-  def start_user(user, event, %{"status" => :stopped} = user_model) do
-    {user, user_model
-    |> Map.put("status", :running)
+  def start_user(user, event, %{"status" => "stopped"} = user_model) do
+    {user, user_model
+    |> Map.put("status", "running")
     |> Map.put("start_time", event.timestamp)}
   end
 
   def start_user(user, event, user_model) when map_size(user_model) == 0 do
     {user, user_model
-    |> Map.put("status", :running)
+    |> Map.put("status", "running")
     |> Map.put("start_time", event.timestamp)}
   end
 

    |> Map.put("last_played", event.ordered_id), new_events}
  end

  def stop_user(user, event, %{"status" => :running, "active_seconds" => active_seconds} = user_model) do
    {user, user_model
    |> Map.put("status", :stopped)
    |> Map.put("active_seconds", ((event.timestamp - user_model["start_time"])/1000) + active_seconds)}
  end

  def stop_user(user, event, %{"status" => :running} = user_model) do
    {user, user_model
    |> Map.put("status", :stopped)
    |> Map.put("active_seconds", ((event.timestamp - user_model["start_time"])/1000))}
  end


    |> Map.put("last_played", event.ordered_id), new_events}
  end

  def actual_units_user(user, event, %{"status" => "stopped"} = user_model, benchmark) do
    actual_units = event.data["units"] / length(event.data["users"])
    uph = actual_units / (user_model["active_seconds"] / 3600)
    percentage = uph/ benchmark

    new_model = user_model
        |> Map.put("status", "completed")
        |> Map.put("actual_units", actual_units)
        |> Map.put("uph", uph)
        |> Map.put("percentage", percentage)
