added a spec
fix some time math