almost done with dispatcher code