math server (really dbmath code)