more tweaking and some fixes