copy over mission logic

logic for creating a mission, copied from applet