attempts to fix c and z calculations II