changing the output to array