move matrix code to matrix.go
go fmt