if(i == (m*.2) || i == (m*.3) || i == (m*.4) || i == (m*.8))

You are comparing an integer type (i) with a float type (m * .2) for equality which is always a bad idea due to the imprecision of...