instead of using a HashMap, we use int[] and double[]
this saves us a huge amount of wasted time in GC for HashMap