Function writing.