fix term comparison math

This grabs the term length and calculates from there. Much DOM.