Just changed a few details, added the timing function