gnostic algorithm fo