debug code, doesn't work yet.