added med_test addition logic, not finished as yet