encoding dates and starting analysis