Added if/in to restrict sample (but not map)