Changed init function