memory peak usage is probably better