this closes issue #7 and some minor other fixes