unknown array length problem