lots of bug correction, uniformization of the functions and new "candidTest.py" which implements a full example