bug fixed, now emb calculations right