survival calculation