A copy of old hedge program (the one where it looked for vertical posts instead of horizontal)