running the basic algorithm with an example