mathset implementation