revised simex code