Updated code to store changes in target and bands