initial matrix setup