big fixes, mostly working