move createP out of loop in the input file