removed temporary assumption of no states less than zero