fixed bug with sum overwritting local_signal
updating with stashed commits for better write