First working implementation. r.0