implement shareddata fns and add tests