add logging to v algorithm