Added parser and some helper functions.