new SED routines based entirely on Erik's
left out one oops