problem solving algorithm implemented...