Conformed changes to official fork and added recursion