some preliminary data parsing code