#0004: Sayali - Machine creation for multiple final states working.
#0002: Sayali/Tanbir - Refactored getStateByName function.