Added optional (if supported by compiler) OpenMP support, polished the code, eliminated additional warnings of g++