COSMIT: pep8 and renaming
COSMIT: replaced assert by assert_less/greater etc.