Code is compiling now
Simplifying code and making it parallel by using OpenMP