various algoritms