Added my own function to Prof. Peng's stub.