some additions and some fixes