updated implementation for pbs