minor optimization in constructor
added test of constructor and export