moved function declaration