move a function up to make sure it is defined before it is used :)