based on the paper IBVH, written in C#