added lots of code for parsing blocks with names.