Fixed basic algorithm