rearranged the fields, addedd h:m:s and some logic