reorder function defintions