reorganized structure
implemented draft for parsing hirarchy
implemented all functionality