file swapping script