Basically completed the function definition