Implemented basic flat and tree elements, tests needed