clean up code & do continuous measurement