added time measuring
minor changes