initial code to create appointment