ifdef matrix stuff