modified optimizer and added random number test...