tweaked off algorithm