death algorithm