init function written
merged