type safe matrix initialization, finally