adjusting the examples
perfecting the algorithm