Define indices for arrays.
Comment out unused palClearPads.
Add hopper thread and clean things up.