new functions: write and reinstall packages