working version of the plugin: corrected lots of issues concerning path, files and directories.