Reduce new variable declaration

reduce the i/o of RAM, so reduced a little time
(for one ii, 0.77s => 0.73s)
Condenced some if and for sequence.