First iteration of autonomous code

Could use a bit of cleaning