updated ordering functionality