some logging for the problematic case
refactored basic algebra out of uni_vts
comments, logging and refactoring