change method for calculating mean shape