add dp function to bash