Moved the code to a file