changed long doubl to double; long double sometimes is not working on windows due to incompatibility between mingw and ms runtime libs