moved calculation of alternative moves to after for loop