seperate input and output streams which makes for less borrow checker errors
move stuff around
fix broken code after stdlib updates