You could also just change this:
Dim $somearray[4]
to this:
Dim $somearray[3]

As I think you know, kixtart arrays are 0 based, so for 4 values, the value you would use is n-1 or 3 in this case.
_________________________
(... better days ahead)