cleanup sum
cleanup dim
add xs cumsum