Work to replace recursive moethod with another non-recursive one and other things