Changed the code to work on windows, directory listing fix remaining