fixed issue with if and recursion
ready to push