working example code
set encoding
move dates code to its own file