completed and tested findTime Function