First (untested) implementation