several more changes to finish issue #5