added marker sort function