adding ordering functionality