updated both putstr to use a single call to write(2)