cleaned up p2I.m