Update README.md

I simplified your code by creating a function which used list comprehension rather then manual accumulation.