Preliminary implementation of the pfe function is working!