removed bug in shape calculation