more tail recursion, style conventions