Added more useful functions, reduce's initial value is now optional