naive, untested implementation