writing match algorithm
writing match algorithm