added the reorganize classes. quite dirty code