Using a bubble sort to figure out sort order of assets