Added some stdio functions and switched text output to printf().