Taking wd as parameter