implemented function defined in MSE693366