refactor sum_scape; add test