I cleaned up the code a little did a couple of these: if (blah > stuff - wah) blah = stuff - wah; changed to.... tmp = stuff - wah; if (blah > tmp) blah = tmp; and combined multiple if statements Kent