some file sorting
stuff got messy