Started writing a more advanced algorithm