Improved description, passed parameter for upper bound on m and improved logging.