How to parse a array and display output