lots of big fixes, slight redesign.