removed dependence on math library