ver1.0 algorithm