Project wont compile when I place functions below function calls
You need to declare your function before you use it.  So either the whole function body needs to be before the usage, or you must add a function prototype declaration.

void myfunction();

myfunction();

void myfunction(){
  return 0;
}