[+BUGFIX] added better encoding functionality