matrix stuff added