removed typos, added conditional to 1st measurement