first parsing and output