improvements in the initialization of the statistcal objects; looping improved when initialzing sample set and wrong indices were used for sumxy