a small pre-dbm. buggy and ugly :)