Remove math library and use simpler expression