Designing a Medication-Dispensing Mechanism