update examples for v4.0.0
organise code better
update readme and documentation
update examples