Moving the measure calculation mechanism

Encompassed measure calculation in its dedicated function so it can be
reused
Completing measure calculation

Added core calculations like min and max to the getMeasure fonction