corrected Pi to handle number of processor not multiple ot the iteration (extra work for the last processor)