Started the structure of the function.

I have the idea and the structure here.