Class A: added flatten feature

See 54
Class A: flatten feature can now deal with class H

See #54
API doc + removed useless code