some additions and fixes