Modified measure.py