classes were messed up upon sort; fixed