Fix logic to choose steps