Revised with forEach
added new branch