fixed matrix creation, now it respects the order of the features