robot leader working code