moved function declarations