optional plotting, plotting function, move measurement to measure.jl in order to enable control over frequency of measurement