added new (untestes algorithm)
some corrections