added lpwd function