made use of parallel package instead of multicore + optimized linear algebra