Finished implementing the parser and added hierarchy printing function