added all fixes
Added demo to test the code samples contained in the paper.