Implemented function definition and application