sort of fixed the pids program

still has some contention sometimes which needs to be fixed,
but otherwise works as long as it doesn't hit that