fixed take_screenshot, streamlined/cleaned code
added debug mode, streamlined code, squashed bugs