v0.5.5 Fixed bugs, refactorization and add tests