reducer Code completed