Revert "modification `is_not_terminal'"

This reverts commit 071f3c2e2f6a0d92a271b7932d1ada7c974911cd.
Revert "formatting code."

This reverts commit 3217425d4667196731cc65f572111cce7cf74ca7.
modification "is_not_terminal"