add code for c-disp in layered media