occasional out of bounds exceptions fixed (hopefully)