Updated code for Loops checkpoint so that all unit tests passed