Added connection between main prog and dll libs. Added some functions for debug