Merged STDP branch from Jamie's Merge Request #3