added encode(Atom) when is_atom(Atom)