Initial version for dynamic version.
Not fully tested.