Created a shitty reduction function.