reads file and parses it