got working with array of unknown size