modified to work with intel c++ compiler