There are three repeated functions in the last part of this code. Please condense them into a single function/module without effecting the output. The functions do the same thing, only parameters changed.
File: https://1drv.ms/u/s!AiezjuZz42bo6hmhCFx1bpqPrBY1?e=Cy40et