encode something complex