Made it possible to use the script as a standalone tool