re-ordering functions