corrected headers and a few code blocks, added some explanatory sentences