added vectorized implementation of the normal equation