Casting Issue Fix

the (int) cast was in the wrong spot. This was causing the code to draw
from the wrong index.