fix incorrect line breaks in file.
add some documentation.
fix bugs in assemble_bundle