Fixed serializable stuff and added reducer class