small changes to rLayerPAP