Moved the function outside