Implemented construction of data matrix by considering state and window as unique words