removed some unused code and fixed up action potential probability calculation