First complete version
some small changes