fixes matrix