added the base code, and the init function