add recursive and iterative solutions