Sort key working and tested

We can now sort values by any key and the gui works great