First working version, already including a sample.