Trying algorithm again