main and parse