changed to 2+3 compatible encoding code, removed landscape hook