added cluster reassignment and some bugfixes