Parser working as intended but needs tidy up