Add code for homogenization