Moved the method definitions to the top