Sameshape function added