implemented shape handling.