naive first draft
use recursion