Add file input & output method and a console tester