Changed double[] to int[]