Count Mega X and Mega Y separately

As it stood, only "X" was being counted before breaking the loop.