   """
 
   @spec roll(any, integer) :: any | String.t
-  def roll(game, roll), do: game ++ [roll]
-
+  def roll(%Bowling{frames: frames}, roll), do: %Bowling{frames: frames ++ [roll]}
   @doc """
   Returns the score of a given game of bowling if the game is complete.
   If the game isn't complete, it returns a helpful message.
   """
   @spec score(any) :: integer | String.t
-  def score(game) do
-    games = game
+  def score(%Bowling{frames: frames}) do
+    games = frames
     |> Enum.flat_map(fn
       10 -> [10, nil]
       a -> [a]


  @spec start() :: any
  def start do
    []
  end

  @doc """

defmodule Bowling do
  defstruct frames: []

  @doc """
  Creates a new game of bowling that can be used to store the results of
  the game
