using sum to slice and sort, few styling mods