Work on basic algorithm.