Remove unnecssary first and last time from id dict