First working and tested version.