Finished first io
Improved io. Some bugs still remain..