Added LatentDA code but not fully working