Correct function definition for extract particles