Usage of Double[] changed to double[]

Small refactor to use data type instead of object array.
And some clean-up.