More measurements, Some code improvements