added a method that replaces certain strings in pred files with variables