Fixed #19. Updated IO class