first full working version, still need to fix problem with date format