Change lists:concat to lists:flatten