pwd optimization