measurements calculation