basic reduce code, let's get cracking