Making better states with quaternions.