The important change is here. Before I had a for in loop and I was running into the interview question problem :)