A first somewhat working version.