Copied over emailed correct version of EPI.cpp.