Implemented code for creating data matrix using only the window values