Added heterogeneous code.