Implemented the ordering functionality;