Improved speed by a factor of 4 or so.