cleaned up battle and fixed distance formula