Moved matrix into a separate package