Fixing x-setup script to work with 'resources', added some comments