Sort:  

Unfortunately it seems to be quite a complicated system to program. For now let's continue inspecting manually even =\