oops, bug array index bug fix