removed hardcoded array size and range