added sharing of embeddings
implemented embedding sharing