pylint: fix commas
add docstrings
Use a closure for block gen function
use list comprehension instead of map
rewrite walker algorithm
add docstring
readability