changed sortByZPosition to sortByProperty functions