Changed return type to double array