added comments, fixed reducer