Added ternary logic

Tightened up smd parse logic.