Loops implemented and working properly