the basic algorithm