big fixes and testing