Completely removed codes that were made redundant by StateMachine two sprints ago
Removed variables that are not referenced to avoid warnings
Merge pull request #633 from Benglin/MAGN255

Removed dead codes and unreferenced variables