preliminary parsing code