remove hardcoded assumptions about array lower bounds