working except for byte[]->double[] conversion