cab assignment logic