removed redundant parameters
added reduce example