shape detection ausgelagert
maybe add some comments