Lots of changes.

This is relating to issue #5 and #6.
Don't know why missing.