Implemented local maxima detections and speading.