Almost done with the init function.