Code for communicating with architecture program added

Lotsa bugfixes

Code must be debugged