AI: Bring back and fix monitonic function