trying to make a recursive method