changed timing to elapsedMillis