Added file i/o capability to optimized code.