rough draft -- I bet I could condense this / make it more idiomatic, but
it works for now