You don't need to loop over all the components to set "start" to the last component's "when". I'm not sure what this code is trying todo.