Editted search function to incorporate PersonType