fixed bug. AC1 working
generalized to any domain type