more extensive tail-call recognition