Optimize Robot Logic