added pid stuff