divide by 2 outside of the loop