Bug fixed, and implementation of some methods