New parsing function, main in order