Added predecessor as an easier exercise.