added another recursion method