calculate time correctly..