trying to vectorize moments acumulation