major update: more comments, package structure changes, bugfixes