update code, widen varibles range