Fixed sorting

Added simple bubble sort algorithm to sort the star-gate rings before
display.