Improved the climbing logic