working on recursion loop