My version of optimization 2 :)