added check on end-of-recursion
fix comment
fix comment