added predict time function