changed logic of loops