start of version 4.0 (rewrite)