Improved the health calculation (it's commented out in the UI)