started on issue #18 and some other adjustments