working on appointment function