Start to implement file io. Add some other stuff