Playing around with the code.
Removed and rewritten the code.
Now returns almost the correct data. Still need to round averageAge correctly.
Now correctly rounds with Math.round()...
Removed some unused vars and comments.
Fixed so ÅÄÖ is also sorted.