use reference instead of embedding
changed reduce to calculate the positions acceleration