Added function for generating the compute-Next-LPU routine