Modified init function