reduce amount of 'functional programming':
find max instead of imperative sort.
replace (/:)() with for(){}.