more tweaking, still incomplete