Noted a bug in the sequential version and fixed it in the parallel version