implement mapcat with reduce as petrosalema suggested; tabs for indent;