1.1.3 algorithm