compute thickness