code improvements using reduce, readme changes