Updating: tidying-up code and minorly improving doc