add encode function
refactoring
bump version