This is correct. But there is one efficiency I can see. Try and find it. I'll give you a hint that another student has figured it out and I've merged their PR. So if you get stumped try looking at recently merged pull requests for the answer. 

Great job!