adding exam function