generic functions written
merged the changes