Clean up code, make finding file work on windows