fixed some of the bugs with dying, fixed #13, fixed #16