Simple algorithmic excercises