changed init_psubst_from_data to also take pattern data