diff --git a/README.md b/README.md
index c174a475f054d207c9bcf3c6d33396968dde95b3..eff30acec7db29e173290f071ce01b9e2b8ddd03 100644
--- a/README.md
+++ b/README.md
@@ -9,8 +9,11 @@ This program uses a library of pre-defined molecule, atom, and bond types to con
 
 ## Use
 To use the program, execute:
+
 `python pdb2lmp.py <PDB/GRO input> <output name>`
+
 e.g.:
+
 `python pdb2lmp.py data/water.pdb water`
 
-  Output DATA and FF files are created using the output name specified appended with the prefixes `.data` and `.ff` respectively.  For the conversion to be successful the molecule names in the import PDB/GRO must match an entry in the PDB2LMP molecule file.  If a molecule is missing it may be added to `data/mol.dat`.
+Output DATA and FF files are created using the output name specified appended with the prefixes `.data` and `.ff` respectively.  For the conversion to be successful the molecule names in the import PDB/GRO must match an entry in the PDB2LMP molecule file.  If a molecule is missing it may be added to `data/mol-elba.json`.
diff --git a/data/bonds.json b/data/bonds.json
index 60629a77e2bf6225c0d3a2e2fa9ac7cdd8d8f152..948424c20965419b5035d36b05657fe0ffc29b67 100644
--- a/data/bonds.json
+++ b/data/bonds.json
@@ -36,15 +36,15 @@
       "sugar-dih-30pc-2": "fourier 2    0.75 3 0   -0.10 1  120",
       "sugar-dih-80pc-1": "fourier 2    0.75 3 0   -0.32 1 -120",
       "sugar-dih-80pc-2": "fourier 2    0.75 3 0   -0.32 1  120",
-      "sugar-glyc-d1-3":   "charmm -0.1801345   1 -123.0662189 0.0",
-      "sugar-glyc-d1-4":   "charmm -0.8522      1 -146.907595  0.0",
-      "sugar-glyc-d1-6":   "charmm  0.4714055   1    0.8067885 0.0",
-      "sugar-glyc-d2-a-34": "charmm -0.819724    1  -65.408620  0.0",
-      "sugar-glyc-d2-a-6":  "charmm  1.312271    1   13.593349  0.0",
-      "sugar-glyc-d2-b-34": "charmm -0.2683885   1  -83.0853785 0.0",
-      "sugar-glyc-d2-b-6":  "charmm -0.542714    1  -26.391433  0.0",
-      "sugar-glyc-d3-a":   "charmm -6.74014666  1  -83.661744  0.0",
-      "sugar-glyc-d3-b":   "charmm -0.05605633  1  -42.276276  0.0"
+      "sugar-glyc-d1-3":   "charmm -0.1801345   1  -123  0.0",
+      "sugar-glyc-d1-4":   "charmm -0.8522      1  -147  0.0",
+      "sugar-glyc-d1-6":   "charmm  0.4714055   1     1  0.0",
+      "sugar-glyc-d2-a-34": "charmm -0.819724   1   -65  0.0",
+      "sugar-glyc-d2-a-6":  "charmm  1.312271   1    14  0.0",
+      "sugar-glyc-d2-b-34": "charmm -0.2683885  1   -83  0.0",
+      "sugar-glyc-d2-b-6":  "charmm -0.542714   1   -26  0.0",
+      "sugar-glyc-d3-a":   "charmm -6.74014666  1   -84  0.0",
+      "sugar-glyc-d3-b":   "charmm -0.05605633  1   -42  0.0"
     },
     "improper":{
       "dipole-cone-1":    "dipole/cone 200  120 60",
diff --git a/data/mol-elba-sugar.json b/data/mol-elba-sugar.json
index aa4fdff147e42ae31d05dabe01ad454268872bc5..47d53f538b56af1a01e7abc891f214d9dfcf298c 100644
--- a/data/mol-elba-sugar.json
+++ b/data/mol-elba-sugar.json
@@ -101,6 +101,13 @@
       "angles":[
         {"type": "sugar-glyc-1", "atoms":["C2", "C3", "+C1"]},
         {"type": "sugar-glyc-2", "atoms":["C3", "+C1", "+C2"]}
+      ],
+      "dihedrals":[
+        {"type": "sugar-glyc-d1-3",    "atoms":["C2",  "C3",  "C4", "+C1"]},
+        {"type": "sugar-glyc-d2-a-34", "atoms":["C3",  "C4", "+C1", "+C2"], "ifnext": "[0-9].A"},
+        {"type": "sugar-glyc-d2-b-34", "atoms":["C3",  "C4", "+C1", "+C2"], "ifnext": "[0-9].B"},
+        {"type": "sugar-glyc-d3-a",    "atoms":["C4", "+C1", "+C2", "+C3"], "ifnext": "[0-9].A"},
+        {"type": "sugar-glyc-d3-b",    "atoms":["C4", "+C1", "+C2", "+C3"], "ifnext": "[0-9].B"}
       ]
     },
     "4XX":{
@@ -110,6 +117,13 @@
       "angles":[
         {"type": "sugar-glyc-1", "atoms":["C3", "C4", "+C1"]},
         {"type": "sugar-glyc-2", "atoms":["C4", "+C1", "+C2"]}
+      ],
+      "dihedrals":[
+        {"type": "sugar-glyc-d1-4",    "atoms":["C2",  "C3",  "C4", "+C1"]},
+        {"type": "sugar-glyc-d2-a-34", "atoms":["C3",  "C4", "+C1", "+C2"], "ifnext": "[0-9].A"},
+        {"type": "sugar-glyc-d2-b-34", "atoms":["C3",  "C4", "+C1", "+C2"], "ifnext": "[0-9].B"},
+        {"type": "sugar-glyc-d3-a",    "atoms":["C4", "+C1", "+C2", "+C3"], "ifnext": "[0-9].A"},
+        {"type": "sugar-glyc-d3-b",    "atoms":["C4", "+C1", "+C2", "+C3"], "ifnext": "[0-9].B"}
       ]
     },
     "6XX":{
@@ -119,6 +133,13 @@
       "angles":[
         {"type": "sugar-glyc-1-C6",    "atoms":["C4", "C5", "+C1"]},
         {"type": "sugar-glyc-2", "atoms":["C5", "+C1", "+C2"]}
+      ],
+      "dihedrals":[
+        {"type": "sugar-glyc-d1-6",   "atoms":["C2",  "C3",  "C4", "+C1"]},
+        {"type": "sugar-glyc-d2-a-6", "atoms":["C3",  "C4", "+C1", "+C2"], "ifnext": "[0-9].A"},
+        {"type": "sugar-glyc-d2-b-6", "atoms":["C3",  "C4", "+C1", "+C2"], "ifnext": "[0-9].B"},
+        {"type": "sugar-glyc-d3-a",   "atoms":["C4", "+C1", "+C2", "+C3"], "ifnext": "[0-9].A"},
+        {"type": "sugar-glyc-d3-b",   "atoms":["C4", "+C1", "+C2", "+C3"], "ifnext": "[0-9].B"}
       ]
     }
   }
diff --git a/data/schema.json b/data/schema.json
index 548af5810901c9d0615ffb4564f19b126065a468..f0381a3570d8c9de84d8716f419c8f5ca4c6cf39 100644
--- a/data/schema.json
+++ b/data/schema.json
@@ -113,7 +113,8 @@
           "maxLength": 2,
           "uniqueItems": true,
           "items": {"type": "string"}
-        }
+        },
+        "ifnext": {"type": "string"}
       }
     },
 
@@ -129,7 +130,8 @@
           "maxLength": 3,
           "uniqueItems": true,
           "items": {"type": "string"}
-        }
+        },
+        "ifnext": {"type": "string"}
       }
     },
 
@@ -145,7 +147,8 @@
           "maxLength": 4,
           "uniqueItems": true,
           "items": {"type": "string"}
-        }
+        },
+        "ifnext": {"type": "string"}
       }
     },
 
diff --git a/lib/moldatabase.py b/lib/moldatabase.py
index 9a74bf45af8d084042d58b1563135ee0eeb6d9fe..49b5a697760f99dadf92c79c770a7fbfa4b4bb80 100644
--- a/lib/moldatabase.py
+++ b/lib/moldatabase.py
@@ -76,7 +76,6 @@ class MolDatabase:
         for mol in self.molecules.values():
             used_templates = set()
             while mol.templates:
-                print(mol.templates)
                 template = mol.templates.pop()
                 if template not in used_templates:
                     mol.extend(self.molecules[template])