#6 move pilinCoord out of loop; fix bug in clipping pilinCoord