Refactored the entire robot simulator