didn't like |> as an operator, replaced it with match