max sorting, not ready
some code cleanup
max breakthrough
sorting colour channels and recombining in max