Finished code for generating LPUs count determining routines