Next iteration of encode script