replace array.push to array[]=
add simulated annealing