Added a text user interface to the main function. May not work well, since I cannot test.