cumsum width calculation