Initial code for a single particle function thread