updated sorting to be more robust and cleaned up some stuff in languages

lol.  just saw this pop up while testing.  :+1: