implemented appointments and has_many :through associations for patients and doctors