MEMM Implementation
Resolving conflicts