autmagically sort layers