finished. added timeval