before matrix stuff