adjusted toplevel to use secd machine