new fast algorithm