Updates off bug

had an array out of bounds becausse of a slight logic error