added hugely complicated sort

working really well though