fixed latex document as well as fixed some bugs in sampling Z and V in code (still testing)