Complete rewrite, new version: 5.0