reworking p backend