added simplified read array
removed bug