Transfer parameter-value from loop to function

Why have you still got multiple different variables named matchtime ? By my count you have 4 of them, each with different scopes