Moved and refactored get_particle_positions()