first working version, without option to set time