print array recursively