update docs, fix bugs, allow printing to stdout in realtime