function is now declared before it is called