  where
    top = head $ drop 1 $ lines line
    bottom = last $ lines line
    right = map last $ drop 1 $lines line
    left = map head $ drop 1 $lines line

makeTileId line = readToInt $ fromJust $ matchDigits $ head $ lines line

isCornerTile :: [[String]] -> [String] -> Bool
isCornerTile tilelist tile = (length . filter notMatching) tile == 2
  where