fixed a bug where the data was stroed in a non contigous fasion