lots of helper functions being written for elementary parsing.