Code for testing use of MSE to compare surfaces