tried to fix streams... Still work in progress