close #41 implemented Chain algo