Reduce

The reduce class and main class are implemented