pid/gid mess improved

Not sure if dependencies are correct. please check.
where are these numbers from?