Built a working Chain implementation