implement new parsing code