updated PWLD routines