Improve the direction changing logic so that balancing on an edge changes direction, and in normal situations direction only changes if the user is pressing a direction