Implement algorighm