Added a copy constructor
Added "set" method
Added an option to make the result 'flat'