SMS: Algebraic theory of molecules