trying algorithm