Writing initialize function