basic algorithm WIP