added sortation and fixed encoding problems