working on new function
merged