#2

don't abuse recursive algorithm