working on the basic algorithm