remove recursion