Fixed #147.
Close #146.

Finished the implementation.