added functions for shape alignment