Added stdin and stdout in working form. Need to do stderr and debug