mapping instead of array_search and comments