Fix comments and unittest for market.py and style

Trying to make the right commit to  the develop branch.
You can try to read the code yourself and correct any line later in your patch at the expense of your time.