Fixing imports and function definition.