cpp-netlib used, many small modifications