Simple parsing function and tests