simplify_shape function

Simplify shape