Code Refactor / Comments

Refactored some code in StructuralFormula / added comments