improved performance, squashed a bug