moved case to the outside and added end conditions for experiment for each case