changed timestamp function a bit