using array and hash