more optimization code..