oops writing to wrong part of array, duh