code with df for all conditions and final results