started to implement openmp. lots of improvements to code