pwd program implementation