Started general pgp scan implementation, seems to work for 2-layers, but there still seems to be a bug when increasing the depth