First version that, at least, looks like working :-)