Significally simplified and improved files sorting