Added solution for Loops