Refactored code.
Implemented code to compute next state table. Refactored code.
Refactored code. Added test case.