Hill climb algorithm