Yet another algorithm example