added shape detection