clean code into multiple scripts, added markdown output