added pw functionality