Updated the diagonal feature extraction algorithm