Added check-for-death to main