Moved function into .cpp