Added some cart structure and new compact topology matrix generator