first semi-supervised commit, doesn't really work yet; plus some minor refactoring