in-place computation