Rough, untested implementation