Changed OS path handling, and refactored the code and console output.