more work on sharing function