Move funtion to avoid forward declaration