Added general autonomous code