You could use this code as a template and add your manipulation instead of storing the activation in the dict.
dict