added basic algorithm