map searching function