Removed semicolon from defeinitions to avoid bugs.
added some missing variables
Created loop around number of processors input.
Added more missing variables