put initial variables into function.