Recursive method with seperate arrays