recursion attempt, works 55%