Adding logic to place recognition