SED from Cube code

Made a pull request while I work on this in case you have comments.