main opens and parses file