Fix z formula