General cleanup
Added support for selection ordering