Cleaned up function code. RantConsole now closes after running file